package leetcode.d1;

import java.util.HashMap;
import java.util.Map;

/**
 * @author hang an
 * @since 2025/7/14
 */
public class R11盛最多水的容器 {
    public static void main(String[] args) {

    }
    public int maxArea(int[] height) {
        int left = 0;
        int right = height.length - 1;
        int res = 0;
        while (left < right) {
            res = Math.max(res, Math.min(height[left], height[right]) * (right - left));
            if (height[left] < height[right]) {
                left++;
            } else {
                right--;
            }
        }
        return res;

    }
}
